import request from '@/utils/request'

/**
 * 获取企业列表
 */
export const getCompanyListAPI = (params) => {
  return request({
    method: 'get',
    url: '/companys',
    params
  })
}

/**
 * 删除用户
 */

export const delCompanyAPI = (id) => {
  return request({
    method: 'delete',
    url: `/companys/${id}`
  })
}

/**
 * 新增企业管理
 */
export const addCompanyAPI = (data) => {
  return request({
    method: 'post',
    url: '/companys',
    data
  })
}

/**
 * 企业管理详情
 */

export const getCompanyDetailAPI = (id) => {
  return request({
    method: 'get',
    url: `/companys/${id}`
  })
}

/**
 * 修改企业管理
 */
export const putCompanyAPI = (data) => {
  return request({
    method: 'put',
    url: `/companys/${data.id}`,
    data
  })
}

/**
 * 修改企业状态
 */
export const updateCompStateAPI = (id, state) => {
  return request({
    method: 'post',
    url: `/companys/${id}/${state}`
  })
}
